package com.spsy.pay.listener;

import com.rabbitmq.client.Channel;
import com.spsy.pay.constant.LxConstant;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * @Author: Kyrie Irving
 * @Date: 2025/10/8 11:36
 * @Description:
 **/
@Component
@RabbitListener(queues = LxConstant.LxQueue)
public class LxListtener{

    @RabbitHandler
    public void handle(String str, Message message, Channel channel) throws Exception{
        System.out.println(str);
        //channel.basicAck(message.getMessageProperties().getDeliveryTag(),true);
        channel.basicNack(message.getMessageProperties().getDeliveryTag(),false,true);
    }

}
